<template>
	<scroll ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" :up="upOption" @up="upCallback"
	 @emptyclick="emptyClick">
		<stop isBack>
			<view slot="content">岗位考核</view>
		</stop>
	<!-- 	<view class="bcf">
			<view class="cu-btn line-green lg round" @tap="showSelectList = !showSelectList"> 选择</view>
			<job-selector :multi="false" :show="showSelectList" @onSelect="selectJob"></job-selector>
		</view> -->
		<view class="">
			<view class="pad3 bdbdo flrc pos-r mart3 bcf" 
			@tap="goto('/pages/ciming/kpi/job_test_user_list?job='+row.id)" 
			v-for="row in data" :key="log.id">
				<view class="flex1">{{row.name}}</view>
				<view class="fa fa-angle-right"></view>
				<ripple></ripple>
			</view>
		</view>
		<loading :loading="myIsLoading"></loading>
	</scroll>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import List from '../../../assets/js/list.js'
	
	import jobSelector from '../../../templete/ciming/job_selector.vue'
	
	export default {
		mixins: [MescrollMixin],
		components:{jobSelector},
		data() {
			let list = new List()
			return {
				list,
				data: [],
				dataInfo:{},
				where: {
					eq: {
						status: '',
						category: '',
						groups: '',
					}
				},
				search: "",
				src: "/api_/zones",
				//岗位选择器相关
				showSelectList:false
			}
		},
		methods: {
			reload() {
				this.showLoading()
				this.list.setData({
					_order: {
						sort: "ASC"
					},
					_where: this.where,
					_search: this.search,
					_g: ['user', 'job'],
					all: false
				}).reload()
			},
			selectJob(val){
				this.log(val)
			}
		},
		mounted() {
			this.list.initMescroll(this).setUrl('/api/jobs').setData({
				_order: {
					sort: "ASC"
				},
				_where: this.where,
				_search: this.search,
				_g: ['user', 'job'],
				all: false
			}).setCbFunc(res => {
				this.data = res
				this.clearLoading()
			}).reload()
		},
		onLoad(option) {
			
		},
		onShow() {
			this.list.reload()
		}
	}
</script>

<style>

</style>
